/**
 * 
 */
package com.sc.softmgr.common.configuration;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.session.data.redis.config.annotation.web.http.EnableRedisHttpSession;
import org.springframework.session.web.http.CookieHttpSessionStrategy;
import org.springframework.session.web.http.HttpSessionStrategy;

/**
 * 
 * @content session存放管理配置
 * 
 * @date 2017年5月15日
 * 
 * @author OprCalf
 * 
 */
@Configuration
@EnableRedisHttpSession(maxInactiveIntervalInSeconds = 3000, redisNamespace = "softmgr") // 5分钟失效
public class HttpSessionConfiguration {

	// 定义session存在http表头,避免客户端禁用cookie无法存session,如果想保存在cookies中,返回CookieHttpSessionStrategy
	@Bean
	public HttpSessionStrategy httpSessionStrategy() {
		return new CookieHttpSessionStrategy();
	}
}
